使用nginx搭建代理服务器 |
您所在的位置:网站首页 › nginx 代理ip › 使用nginx搭建代理服务器 |
使用 nginx 搭建代理服务器
公司残忍的把 封掉了,但作为程序猿怎么能罢休呢,正好有个 vps ,就用它搭建一个代理服务器吧 ^^ 其实很简单,只要简单配置即可
server {
listen 8080;
resolver 8.8.8.8;
location /{
proxy_pass ://$_host$request_uri;
#allow 127.0.0.1;
#deny all;
}
} 注意:必须加上 resolver 8.8.8.8; 给 nginx 指定 dns ,否则会报告 “nginx 502 bad gateway” 错误,也可以通过 allow 和 deny 来设置只有指定 IP 能够访 问,修改后重启 nginx ,在 登陆的时候设置代理服务器类型是,端口 8080 即可登陆 ^^ |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |